package com.flag.liutao.modules.user.mapper;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.flag.liutao.modules.user.domain.User;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.flag.liutao.modules.user.param.UserCountQueryParam;
import com.flag.liutao.modules.user.vo.UserCountVo;
import com.flag.liutao.modules.user.vo.UserDTO;
import com.flag.liutao.modules.user.vo.UserQueryVo;
import com.flag.liutao.modules.user.vo.UserVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.io.Serializable;
import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author godM
 * @since 2022-11-18
 */
@Mapper
@Repository
public interface UserMapper extends BaseMapper<User> {

    List<String> getAuthorities(Long id);

    IPage<UserQueryVo> getUserPage(IPage<UserQueryVo> iPage, @Param("keyword") String keyword, @Param("gradeId") Long gradeId, @Param("majorId") Long majorId, @Param("deptId") Long deptId, @Param("unitId") Long unitId, @Param("roleId") Long roleId,@Param("status")Integer status);
    
    UserQueryVo selectUserInfoById(@Param("id") Serializable id);

    UserVo getUserByUnitId(@Param("id") Serializable id);

    UserDTO getUserDtoByUintIdAndGradeId(@Param("gradeId") Long gradeId,@Param("unitId")Long unitId);

    List<UserCountVo> selectUserCount(@Param("gradeId")Long gradeId, @Param("sex")Integer sex);
}